home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 5
/
Aminet 5 - March 1995.iso
/
Aminet
/
util
/
misc
/
spectral.lha
/
ReadMe
next >
Wrap
PGP Signed Message
|
1994-11-07
|
5KB
|
116 lines
-----BEGIN PGP SIGNED MESSAGE-----
THE FASTEST SPECTRAL ANALYZER
by Kim Øyhus (c)1994
Have you ever wanted to see the structure of sound? Then run this program!
You need an amiga with 68000 or 68020 processor, and a paralell port sampler.
The sound is analyzed, and split into 250 separate tones/pitches. (in PAL TV)
The lower tones/pitches are lower on the screen, while higher pitches are
higher on the screen. Each whitish line marks 1000Hz. The longer each red
line is, the louder is that tone/pitch.
Sample speed: 15625 Hz
Frequeny range: 7780 Hz
Bands: 250
Band distance: 62 Hz
Bandwidth: 124 Hz
Dynamic range: 48 dB
Dynamic resolution: 6 dB/16pixels
Refresh rate: 10 Hz (On 8MHz 68000 CPU, A1000 !)
Speed of Fourier transform: 20 transforms/sec, or 10000 samples/sec. (!)
Length of Fourier transform: 504
Windowing: Hanning.
The frequency scale is linear, from 0-7.8 KHz, while the loudness scale
is logarithmic, with a range of 48 dB, on 256 pixels.
To freeze the spectrum, hold the mouse button down.
To dump spectrum to standard out, make a short click with mouse button.
F.ex. write "Spectral >OutData" to get the data into a file.
If you have got the free demonstration version, a band of frequencies will
be missing, and the freeze and dump abilities will be removed.
To get the complete working version, send USD 30, 200 KR, or 20 lb, as
postal order, international cheque, or cash, through the mail, to:
Kim Øyhus
Nedre Bjertnes 16
1482 Nittedal
NORWAY kim@pvv.unit.no
PS: If you dont have an AudioMaster compatible sampler, i.e. UBYTE, unsigned
char, but instead another, i.e. BYTE, signed char, then tell so when ordering.
ABOUT THE PROGRAM
I feel I can safely say that this program is the fastest spectral analyzer
program ever to be made on the Amigas above. How can I be so sure?
Well, I have used the fastest methods I could get, in all the code.
The heart of the spectral analyzer is the Fourier transform, which splits
the sample into different frequencies. I use a Large Winograd transform,
which is modified to work on real numbers, since this takes just half the
time compared to transforming complex numbers. All the arithmetic is scaled
to fit within the 16bit memory 32bit register structure of the Amiga.
(Least common attributes) The algorithm is able to transform by using just 1.6
multplications per sample, while conventional algorithms may use 28, or
21 if it is well made. The Hanning windowing is done with just 2 additions.
In order to sample precisely, i.e. no jitter, I synchronize the sampling
with the screen line rate, at 64us, 15625Hz. To synchronize, I use the
copper to generate interrupts level 6, while the processor is in interrupt
level 5, doing a STOP instruction, and therefore jumps immediately to the
level 6 interrupt server, which immediately sample a value, and returns.
This method keeps the jitter under 0.3us, which is sufficient for 8 bits
sampling.
In addition, short pieces of code are run between each sample. The program
samples while at the same time doing windowing, power calculation, logarithms,
and drawing. The logarithms are of course done with a 64KB signed table
index. Drawing lines on screen would have taken far too long time. The
lines are done by letting the copper generate a new screen pointer for
each line, and have them point to pre-drawn lines.
Unfortunately may 68030 and higher processors cause trouble, since they
have different interrupt vector structure. I have also not tested this
program in NTSC TV.
This spectral analyzer is my farewell to the Amiga. My A1000 was one of
the 5 first Amigas to get into Norway in 1984, and I am still using it now.
The program was written in Lattice C and assembler, and took many years to
write. It really is state of the art. It was barely possible to make it.
In a couple of days, I will get my new computer, a RISC PC from Acorn.
The only computer worthwile as a replacement for an Amiga. 1994.11.25
The spectral analyzer is already translated to it.
Kim0
- -----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.3a.2
mQCNAi1+/aoAAAEEAKo+n2YBw8FmVk3wHeibgSaUQwpDqkwffk9uLKawq1GBM+8R
poUWfn3BKAszz6hMctbCeaKvyNN97XTbdvrDbomthO2jzH/t0Q7/2d6mOgSFm6lX
W0s6LYUcw9QCSHzzdTCDAPNVrBb0uUbGbkHEac498j36DJ8Cp2Ha3T3HkBnlAAUR
tBxLaW0gT0V5aHVzIDxraW1AcHZ2LnVuaXQubm8+iQBVAgUQLX8Dvg4AjWeDsA7P
AQETqAH+OhShI9WDGYoFrLJ+vjXFxbEvjtij0HoXTLIbHt3btw7er5Ocbo/FcikV
rtddMmPs/k+DqwM77EsRVryKL0kXNw==
=K++e
- -----END PGP PUBLIC KEY BLOCK-----
-----BEGIN PGP SIGNATURE-----
Version: 2.3a.2
iQCVAgUBLr8I92Ha3T3HkBnlAQHnMAP/SsgdUmGyljMabKWD+PtO79l/1eN7dN7V
5mH5NBi9PHk64ZsNmsLQAWFku2n3AFk2ea0KGJ+2BIMx1Lq4EDi+YdeGMW6eFSVB
O7uEf36WULVfRVAMpYYmfSRhhh1/QOXobqbTDmhjR07STavE+AC7ySL9wlhZqx0G
LPkr7P/ixZA=
=PWOR
-----END PGP SIGNATURE-----